<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="clr-namespace:DesktopAlert">

    <ControlTemplate x:Key="CloseButtonTemplate" TargetType="{x:Type Button}">
        <Grid Background="Transparent">
            <Viewbox>
                <ContentPresenter/>
            </Viewbox>
        </Grid>
        <ControlTemplate.Triggers>
            <Trigger Property="IsMouseOver" Value="True">
                <Setter Property="BitmapEffect">
                    <Setter.Value>
                        <OuterGlowBitmapEffect GlowSize="12" GlowColor="White"/>
                    </Setter.Value>
                </Setter>
            </Trigger>
            <Trigger Property="IsPressed" Value="True">
                <Setter Property="BitmapEffect">
                    <Setter.Value>
                        <OuterGlowBitmapEffect GlowSize="12" GlowColor="DarkGray"/>
                    </Setter.Value>
                </Setter>
            </Trigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>
    
    <Style TargetType="{x:Type local:DesktopAlertBase}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type local:DesktopAlertBase}">
                    <Border Background="{TemplateBinding Background}"
                            BorderBrush="{TemplateBinding BorderBrush}"
                            BorderThickness="{TemplateBinding BorderThickness}"
                            SnapsToDevicePixels="True">
                        <Grid>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="20"/>
                                <RowDefinition/>
                            </Grid.RowDefinitions>
                            <Grid Grid.Row="0" Background="#3B5998">
                                <Grid>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition/>
                                        <ColumnDefinition Width="20"/>
                                    </Grid.ColumnDefinitions>
                                    <TextBlock Grid.Column="0" Margin="5, 2, 0, 0" FontWeight="Bold" FontSize="12" 
                                               Opacity="1.0" Text="{TemplateBinding Title}" Foreground="White"/>
                                    <Button x:Name="PART_CloseButton" 
                                                Grid.Column="1"
                                                HorizontalAlignment="Right" VerticalAlignment="Top"
                                                Template="{StaticResource CloseButtonTemplate}"
                                                Width="18" Height="18" 
                                                FontWeight="Bold"
                                                Foreground="White"
                                                >x</Button>
                                </Grid>
                            </Grid>
                            <ContentControl Grid.Row="1" Content="{TemplateBinding Content}"/>
                        </Grid>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>
